//
//  CaseAddDesView.m
//  FastDoctor
//
//  Created by 程建良 on 16/7/9.
//  Copyright © 2016年 sc. All rights reserved.
//

#import "CaseAddDesView.h"
@interface CaseAddDesView()
@property (nonatomic,strong)UILabel *desLabel;
@property (nonatomic,strong)UILabel *caseImageLabel;
@property (nonatomic,strong)UIView *lineView;
@end
@implementation CaseAddDesView
-(instancetype)init{
    if (self = [super init]) {
        [self setupUI];
    }
    return self;
}
-(void)setupUI{
    [self setupDesLabel];
    [self setupCaseDesTf];
    [self setupLineView];
    [self setupCaseImageLabel];
    [self setupImageButton];
}
-(void)setupLineView{
    self.lineView = [[UIView alloc]init];
    self.lineView.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:self.lineView];
}
-(void)setupDesLabel{
    self.desLabel = [[UILabel alloc]init];
    self.desLabel.text = @"病症描述:";
    self.desLabel.font = [UIFont systemFontOfSize:13];
    [self.desLabel sizeToFit];
    [self addSubview:self.desLabel];
}
-(void)setupCaseDesTf{
    self.desTf = [[UITextView alloc]init];
    [self.desTf setBackgroundColor:[UIColor lightGrayColor]];
    self.desTf.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.desTf];
}
-(void)setupCaseImageLabel{
    self.caseImageLabel = [[UILabel alloc]init];
    self.caseImageLabel.text = @"病例照片:";
    self.caseImageLabel.font = [UIFont systemFontOfSize:13];
    [self.caseImageLabel sizeToFit];
    [self addSubview:self.caseImageLabel];
}
-(void)setupImageButton{
    self.imageButton = [[UIButton alloc]init];
    [self.imageButton setBackgroundImage:[UIImage imageNamed:@"compose_pic_add_highlighted"] forState:UIControlStateNormal];
    [self addSubview:self.imageButton];
}
-(void)layoutSubviews{
    [super layoutSubviews];
    [self.desLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(5);
        make.left.offset(5);
    }];
    [self.imageButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.offset(-20);
        make.left.offset(20);
        make.width.mas_equalTo(80);
        make.height.mas_equalTo(80);
    }];
    [self.caseImageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.imageButton.mas_top).offset(-10);
        make.left.offset(5);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.caseImageLabel.mas_top).offset(-5);
        make.left.offset(7);
        make.right.offset(0);
        make.height.mas_equalTo(1);
    }];
    [self.desTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.desLabel.mas_bottom).offset(5);
        make.left.offset(5);
        make.right.offset(-5);
        make.bottom.mas_equalTo(self.lineView.mas_top).offset(-5);
    }];
}
@end
